package com.qwc.blog.entity.vo.user;

import com.qwc.blog.entity.User;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * @author qwc
 * @Date 2021/10/27 9:14
 */
@Data
public class UpdateUserDto extends PutProfileDto {
    @NotNull(message = "用户id不能为空")
    private Integer userId;
    @NotNull(message = "用户状态不能为空")
    private String status;
    private String introduction;

    public User createUser() {
        User user = new User();
        user.setUserId(userId);
        user.setStatus(status);
        user.setIntroduction(introduction);
        user.setNickname(this.getNickname());
        user.setSex(this.getSex());
        user.setPhoneNumber(this.getPhoneNumber());
        user.setEmail(this.getEmail());
        return user;
    }
}
